package com.fastlib.demo;

import com.fastlibrary.demo.R;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;

public class MainActivity extends FragmentActivity implements OnClickListener{

	

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		findViewById(R.id.BaseListFragmentDemo).setOnClickListener(this);
		findViewById(R.id.BindingAdapterDemo).setOnClickListener(this);
		findViewById(R.id.MaterialDemo).setOnClickListener(this);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		int id = item.getItemId();
		if (id == R.id.action_settings) {
			return true;
		}
		return super.onOptionsItemSelected(item);
	}

	@Override
	public void onClick(View arg0) {
		Intent intent=null;
		switch (arg0.getId()) {
		case R.id.BaseListFragmentDemo:
			intent=new Intent(this, BaseListFragmentActivity.class);
			startActivity(intent);
			break;
		case R.id.BindingAdapterDemo:
			intent=new Intent(this,BindingViewDemo.class);
			startActivity(intent);
			break;
		case R.id.MaterialDemo:
			intent=new Intent(this,MaterialDemo.class);
			startActivity(intent);
			break;
		default:
			break;
		}
	}
}
